package com.biz.primus.model.misc.utils;


import javax.xml.bind.JAXB;
import java.io.ByteArrayInputStream;

/**
 * @author yanweijin
 * @date 2017/6/1
 */
public class XmlUtils {

    public static <T> T xml2obj(final String xmlContent, Class<T> type) {
        return JAXB.unmarshal(new ByteArrayInputStream(xmlContent.getBytes()), type);
    }

}
